package com.mxx.common.observer;

import android.app.Activity;


/**
 * 作者：刘江飞
 * 时间：2020/9/1  10:02
 * 邮箱：642371742Z@qq.com
 * 描述：
 **/
public abstract class DefaultModelObserver extends CommonObserver {
    public DefaultModelObserver(Activity mActivity) {
        super(mActivity);
    }

    public DefaultModelObserver(boolean isShowLoading, Activity mActivity) {
        super(mActivity);
        this.isShowLoading = isShowLoading;
    }

    public DefaultModelObserver(boolean isShowLoading, boolean isShowToast, Activity mActivity) {
        super(mActivity);
        this.isShowLoading = isShowLoading;
        this.isShowToast = isShowToast;
    }

    @Override
    protected void handlerJsonData(String json) {
        mLogger.i("JsonObject类型的数据:" + json);
        if (json.startsWith("{")) {
            handlerJsonObjectData(json);
        } else {
            handlerJsonStringData(json);
        }
    }

    protected abstract void handlerJsonObjectData(String objectJson);

    protected void handlerJsonStringData(String objectJson) {

    }

}
